<?php
  session_start();

  if(!isset($_SESSION['isLogged'])){
    header('Location: index.php');
  }
  $now=time();
  if($now>$_SESSION['expired']){
    session_unset();
    session_destroy();
    header('Location: index.php');
  }

?>

<html>
<head>
  <title>[eCuti] RUH Persetujuan Cuti</title>
    <link rel="shortcut icon" href="images/users.ico" type="image/x-icon"> 
  <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
  <link rel="stylesheet" href="css/pager.css">
    <link href="css/button.css" type="text/css" rel="stylesheet">
  <link href="css/tab.webfx.css" type="text/css" rel="stylesheet">
  <link href="css/calendar.css" type="text/css" rel="stylesheet">
  <script type="text/javascript" src="js/foredit.js"></script>
    <script type="text/javascript" src="js/forpager.js"></script>
  <script type="text/javascript" src="js/tabpane.js"></script>
  <script type="text/javascript" src="js/calendar.js"></script>
  <script type="text/javascript" src="js/calendar-id.js"></script>
  <script type="text/javascript" src="js/calendar-setup.js"></script>
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">

<script type="text/javascript" src="js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/jquery.dimensions.js"></script>
<script type="text/javascript" src="js/jquery.positionBy.js"></script>
<script type="text/javascript" src="js/jquery.jdMenu.js"></script>
<script type="text/javascript" src="js/ecuti.js"></script>

<link rel="stylesheet" href="css/jquery.jdMenu.css" type="text/css">
<div id="banner">
  <img src="images/header.png">
</div>
<form name="fMenu" id="fMenu" method="post" action="">
<input type="hidden" id="actmenu" name="actmenu">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr> 
    <td valign="top" colspan="2">
  
  <div>
    <ul class="jd_menu">
    
    
  <li><a href="ecuti.php">Home</a></li>
  <li>Proses&nbsp;<img src="images/down_m.gif">
    <ul>
    <li><a href="cuti.php">Pengajuan Cuti</a></li>
    <li><a href="setuju_cuti.php">Persetujuan Cuti</a></li>
    <li id="pic" style="display:none;"><a href="batal_cuti.php">Pembatalan Cuti</a></li>
    
    </ul>
  </li>
  <li id="pic2" style="display:none;">Pengaturan&nbsp;<img src="images/down_m.gif">
    <ul>
    <li><a href="libur.php">Hari Libur dan Cuti Bersama</a></li>
    <li><a href="tunda.php">Penundaan Cuti</a></li>
    </ul>
  </li>
  <li>Laporan&nbsp;<img src="images/down_m.gif">
    <ul>
    <li>Pegawai&nbsp;<img src="images/left_m.gif">
      <ul>
        <li><a href="form.php">Formulir Pengajuan Cuti</a></li>
      <li><a href="data_kartu.php">Kartu Cuti</a></li>
      </ul>
    </li>
    <li id="pic3" style="display:none;">Kepegawaian&nbsp;<img src="images/left_m.gif">
      <ul>
      <li><a href="list_pegawai.php">Daftar Pegawai Cuti</a></li>
      <li><a href="data_rekap.php">Rekapitulasi Cuti</a></li>
      <li>Kartu Cuti&nbsp;<img src="images/left_m.gif">
          <ul>
              <li><a href="kartu_cuti.php">RUH Kartu Cuti</a></li>
              <li><a href="input_kartu.php">Input Cuti</a></li>
          </ul> 
      </li>
      <li><a href="cuti_ln.php">Proses Cuti Luar Negeri</a></li>
    </li>
    </ul>
    </li>
    </ul>    
      <li><font color="yellow">Keluar </font><img src="images/down_m.gif">
        <ul>
          <li><a href="portal.php">Kembali ke Menu</a></li>
          <li><a href="logout.php"><font color="yellow">Logout</font></a></li>
        </ul>
      </li>
    </ul>
  </div>
  </td>
</tr>
<tr height="20" style="font-family: sans-serif, Tahoma; background-color:#ece9d8;">
  <td nowrap style="padding-left:5" id="tanggal">
    
  </td>
    <td align="right" nowrap style="padding-right:5;color:#666;padding-right:10px">
      <b>User ID: </b><span id="nip"></span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;     
  
  
   <b>Unit: </b><span id="unit"></span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

  <b>Jabatan: </b><span id="jabatan"></span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

  </td>
  
</tr>
</table>
</form>
<script language="JavaScript">

function do_changeRoles() 
{
  document.getElementById("sJur").value = ""; 
  document.getElementById("actmenu").value = "changeRole"; 
  document.getElementById("fMenu").submit();
}

</script>

<div align="center">
  <table width="700">
  <tr height="30">
    <td align="center" colspan="2" class="PageTitle">Persetujuan CUTI</td>
  </tr>
</table>
<table width="100">
  <tr>
  <td align="center">
    <a href="javascript:goSetuju();" id="setujuButton" class="buttonshort"><span class="save">Setuju</span></a>
  </td>
  <!-- <td align="center">
    <a href="javascript:goBatal();" id="batalButton" class="buttonshort"><span class="delete">Batal Setuju</span></a>
  </td> -->
</tr>
</table>
<br>
<table width="300">
  <tr>
    <td align="center">
<div style="display:none;text-align:left;border:1px solid #777;margin-top:10px;padding:5px" id="div_error">
      <div style="font-size:14px;color:red" id="error"></div>
</div>
</td>
  <td align="center">
<div style="display:none;text-align:left;border:1px solid #777;margin-top:10px;padding:5px" id="div_sukses">
      <div style="font-size:14px;color:green" id="sukses"></div>
</div>
</tr>
</td>
</table>
<div  class="tab-pane" id="showForm" style="display:block;width:75%";>
    <div class="tab-page" >
      <h2 class="tab">Sebagai Pejabat Yang Menyetujui</h2>      
      <table width="100%" cellspacing=0 cellpadding="4" class="DetailStyle" id="list_cuti_setuju">
        <thead>
        <tr>
      <td colspan="7" class="SubHeaderBGAlt">Cuti Belum Disetujui</td>
      </tr>
      
      <tr> 
      <td class="DataLabel" width="15%">Nama</td>
      <td class="DataLabel" width="10%">NIP</td> 
      <td class="DataLabel" width="10%">Tanggal Pengajuan</td>
      <td class="DataLabel" width="15%">Tanggal Cuti</td>
      <td class="DataLabel" width="5%">Jumlah Hari</td>
      <td class="DataLabel" width="10%">Jenis Cuti</td>
      <td class="DataLabel" width="2%">Pilih</td>
        </tr>
        </thead>
        <form>
      <tbody>
      
    </tbody>
  </form>
     </table>
      <table width="100%" cellspacing=0 cellpadding="4" class="DetailStyle" id="list_cuti_setuju_sudah">
        <thead>
        <tr>
      <td colspan="7" class="SubHeaderBGAlt">Cuti Sudah Disetujui</td>
      </tr>
      
      <tr>
      <td class="DataLabel" width="15%">Nama</td>
      <td class="DataLabel" width="10%">NIP</td> 
      <td class="DataLabel" width="10%">Tanggal Pengajuan</td>
      <td class="DataLabel" width="15%">Tanggal Cuti</td>
      <td class="DataLabel" width="5%">Jumlah Hari</td>
      <td class="DataLabel" width="10%">Jenis Cuti</td>
      <!-- <td class="DataLabel" width="2%">Pilih</td> -->
        </tr>
        </thead>
        <form>
      <tbody>
      
    </tbody>
  </form>
     </table>
</div>
    <div class="tab-page" >
      <h2 class="tab">Sebagai Atasan Langsung</h2>      
      <table width="100%" cellspacing=0 cellpadding="4" class="DetailStyle" id="list_cuti_atasan">
        <thead>
        <tr>
      <td colspan="7" class="SubHeaderBGAlt">Cuti Belum Disetujui</td>
      </tr>
      
      <tr> 
      <td class="DataLabel" width="15%">Nama</td>
      <td class="DataLabel" width="10%">NIP</td> 
      <td class="DataLabel" width="10%">Tanggal Pengajuan</td>
      <td class="DataLabel" width="15%">Tanggal Cuti</td>
      <td class="DataLabel" width="5%">Jumlah Hari</td>
      <td class="DataLabel" width="10%">Jenis Cuti</td>
      <td class="DataLabel" width="2%">Pilih</td>
        </tr>
        </thead>
        <form>
      <tbody>
      
    </tbody>
  </form>
     </table>
      <table width="100%" cellspacing=0 cellpadding="4" class="DetailStyle" id="list_cuti_atasan_sudah">
        <thead>
        <tr>
      <td colspan="7" class="SubHeaderBGAlt">Cuti Sudah Disetujui</td>
      </tr>
      
      <tr>
      <td class="DataLabel" width="15%">Nama</td>
      <td class="DataLabel" width="10%">NIP</td> 
      <td class="DataLabel" width="10%">Tanggal Pengajuan</td>
      <td class="DataLabel" width="15%">Tanggal Cuti</td>
      <td class="DataLabel" width="5%">Jumlah Hari</td>
      <td class="DataLabel" width="10%">Jenis Cuti</td>
      <!-- <td class="DataLabel" width="2%">Pilih</td> -->
        </tr>
        </thead>
        <form>
      <tbody>
      
    </tbody>
  </form>
     </table>
</div>
    <div class="tab-page" >
      <h2 class="tab">Sebagai Pengganti</h2>      
      <table width="100%" cellspacing=0 cellpadding="4" class="DetailStyle" id="list_cuti_ganti">
        <thead>
        <tr>
      <td colspan="7" class="SubHeaderBGAlt">Cuti Belum Disetujui</td>
      </tr>
      
      <tr> 
      <td class="DataLabel" width="15%">Nama</td>
      <td class="DataLabel" width="10%">NIP</td> 
      <td class="DataLabel" width="10%">Tanggal Pengajuan</td>
      <td class="DataLabel" width="15%">Tanggal Cuti</td>
      <td class="DataLabel" width="5%">Jumlah Hari</td>
      <td class="DataLabel" width="10%">Jenis Cuti</td>
      <td class="DataLabel" width="2%">Pilih</td>
        </tr>
        </thead>
        <form>
      <tbody>
      
    </tbody>
  </form>
     </table>
      <table width="100%" cellspacing=0 cellpadding="4" class="DetailStyle" id="list_cuti_ganti_sudah">
        <thead>
        <tr>
      <td colspan="7" class="SubHeaderBGAlt">Cuti Sudah Disetujui</td>
      </tr>
      
      <tr>
      <td class="DataLabel" width="15%">Nama</td>
      <td class="DataLabel" width="10%">NIP</td> 
      <td class="DataLabel" width="10%">Tanggal Pengajuan</td>
      <td class="DataLabel" width="15%">Tanggal Cuti</td>
      <td class="DataLabel" width="5%">Jumlah Hari</td>
      <td class="DataLabel" width="10%">Jenis Cuti</td>
      <!-- <td class="DataLabel" width="2%">Pilih</td> -->
        </tr>
        </thead>
        <form>
      <tbody>
      
    </tbody>
  </form>
     </table>
</div>
    <form method="post" id="frm_setuju" action="" name="frm_setuju">
     <input type="hidden" id="frm_aksi" name="frm_aksi"/>
     <input type="hidden" id="id_aksi" name="id_aksi"/>
     <input type="submit" id="btn_simpan" class="ControlStyle" size="22" style="display: none;"/>
   </form>
   
<script type="text/javascript" src="js/setuju_cuti.js"></script>
</div>
</body>
</html>

<script type="text/javascript">

function goSetuju() {
  var isChecked = $("input:checked").val();
  if(typeof isChecked!=='undefined'){
      document.getElementById("frm_aksi").value = "setuju";
      document.getElementById("id_aksi").value = isChecked;
      var retval;
      retval = confirm("Anda yakin untuk SETUJU cuti ini ? \nPERHATIAN : Pastikan Cuti Benar!");
      if (retval) {
        $("#btn_simpan").trigger('click');
      }else{
        document.getElementById("frm_aksi").value = "";
      }
  }else{
    alert("Pilih Item Terlebih Dahulu");
  }
}

function goBatal() {
  var isChecked = $("input:checked").val();
  if(typeof isChecked!=='undefined'){
      document.getElementById("frm_aksi").value = "batal";
      document.getElementById("id_aksi").value = isChecked;
      var retval;
      retval = confirm("Anda yakin untuk membatalkan persetujuan ini ? \nPERHATIAN : Pastikan Bahwa Cuti Belum Dilaksanakan!");
      if (retval) {
        $("#btn_simpan").trigger('click');
      }else{
        document.getElementById("frm_aksi").value = "";
      }
  }else{
    alert("Pilih Item Terlebih Dahulu");
  }
}


</script>